<template>
	<el-switch
  v-model="value1"
  @change="切换事件"
   active-text='on' inactive-text='off' width='50px'
  
/>

<br />
<!-- 颜色例子 -->
<el-switch
  v-model="value2"
  style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
  active-text="左颜色例子"
  inactive-text="右颜色例子"
/>
<br />
</template>
<script setup>
import { ref } from 'vue'

const value1 = ref(true)
const value2 = ref(true)
const 切换事件=()=>{console.log('切换啦')}
</script>
<style lang="scss"  scoped>

</style>